/*
 * BigInteger.h
 *
 *  Created on: Jun 18, 2010
 *      Author: Lukasz Spintzyk
 */

#ifndef BIGINTEGER_H_
#define BIGINTEGER_H_

#include "ph.h"
#include <openssl/bn.h>
#include <boost/operators.hpp>

class BigInteger: public boost::addable< BigInteger, boost::incrementable<BigInteger> >
{
public:
	BigInteger(uint32_t init);
	BigInteger(const std::string& iv, uint32_t init_add);
	BigInteger(const BigInteger& copy);
	~BigInteger();

	BigInteger& operator++();
	BigInteger& operator+(const BigInteger& add);
	BigInteger& operator+(const unsigned long val);
	void add(const unsigned long val);
	bool operator==(const BigInteger& cmpVal) const;

	int getBinValue(byte*) const;
	char* c_str() const;


	BIGNUM* value;
};

#endif /* BIGINTEGER_H_ */
